﻿using App.BaseObject;
using App.Configuration;
using App.WebApi.Controllers;
using System;
using System.Web.Http.Results;

namespace App.Web.Apis
{
    public partial class DictionaryController : AppApiControllerBase
    {
        private ICommonAppService _commonService;
        public DictionaryController(ICommonAppService commonService)
        {
            _commonService = commonService;
        }

        public JsonResult<GridResult> GetDictionarys(int page, int rows, string sort = "CreationTime", string order = "asc", Guid? teamId = null, string filterRules = "")
        {
            int total;
            var where = "";

            var query = _commonService.GetPageRecords<Dictionary>(where, page, rows, sort, order, out total,
                filterRules);

            return Json(new GridResult { total = total, rows = query });
        }
    }
}
